<?php
/**
 +------------------------------------------------------------------------------
 * ArchivesModel 数据对象映射类
 +------------------------------------------------------------------------------
 * @category   SubModel
 * @package  app
 * @subpackage  Model
 * @author   朝闻道 <hydata@gmail.com>
 * @date 2011-3-6
 * @time  上午10:44:05
 +------------------------------------------------------------------------------
 */
class ArchivesModel extends Model {
	protected $_auto = array (
		array ('ctime', 'time', 1, 'function' ),
		array ('etime', 'time', 2, 'function' )
	);
	
	public function CheckVerify($verify) {
		if (md5 ( $verify ) != Session::get ( 'verify' ))
			return false;
		return true;
	}
	
	//自动验证
	protected $_validate = array (
		array ("title", "require", "标题必须！" ), 
		array ('cid', 'require', "类别必须！" ), 
		array ('content', 'require', "内容必须！" ), 
		//array ('verify', 'require', '验证码必须！' ), 
		//array ('verify', 'CheckVerify', '验证码错误！', 0, 'callback' )
	 );
}//end ArchivesModel